package cn.cimoc.controller;

import cn.cimoc.annotation.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/test")
@ResponseResult
@Api(value = "Test Controller", tags = "测试接口")
public class TestController {

    @ApiOperation(value = "简单地测试权限", notes = "需要'test'权限，或者最高权限：'app:all'")
    @GetMapping("/hello")
    @PostAuthorize("hasAnyAuthority('test', 'app:all')")
    public String hello() {
        return "hello";
    }


}
